#include "EbnAction.h"
#include "EbnActionMsgSender.h"
#include "EbnModel.h"

CEbnAction::CEbnAction(string name)
{
    mName = name;
    mpMsgSender = new CEbnActionMsgSender(this);

    GETMSGRECEIVER()->attachMsgSender(mpMsgSender);
}

CEbnAction::~CEbnAction(void)
{
    GETMSGRECEIVER()->detachMsgSender(mpMsgSender);

    delete mpMsgSender;
    mpMsgSender = NULL;
}

string CEbnAction::getName()
{
    return mName;
}

void CEbnAction::action(void)
{
    mpMsgSender->onActionSelected();
}

CEbnActionMsgSender * CEbnAction::getMsgSender(void)
{
    return mpMsgSender;
}
